/*
 * @Descripttion:
 * @version:
 * @Author: 淏
 * @Date: 2023-11-18 11:29:00
 * @LastEditors: 淏
 * @LastEditTime: 2024-03-12 12:27:47
 */
const { defineConfig } = require('@vue/cli-service')
const path = require('path')
function resolve(dir) {
  return path.join(__dirname, dir) //path.join(__dirname) 设置绝对路径
}
module.exports = defineConfig({
  publicPath: './', //基本路径
  outputDir: 'JCY_manage', // 输出文件目录
  assetsDir: 'static',
  pluginOptions: {
    electronBuilder: {
      customFileProtocol: './',
    },
  },
  // 关闭线上源码
  productionSourceMap: false,
  transpileDependencies: true,
  devServer: {
    client: {
      overlay: false,
    },
    open: true,
    port: 9092,
    headers: {
      'Access-Control-Allow-Origin': '*',
    },
    /* proxy: {
      '/api': {
        target: 'http://192.168.1.239:28080',
        ws: true,
        changeOrigin: true,
        pathRewrite: {
          '^/api': '',
        },
      },
    }, */
  },
  chainWebpack: (config) => {
    config.resolve.alias
      .set('@', resolve('./src'))
      .set('views', resolve('./src/view'))
      .set('assets', resolve('./src/assets'))
    //...可以继续自定义别名
    //set 第一个参数：设置的别名；第二个参数：原来默认的路径
  },
})
